package com.axonactive.yolo.webservice;

import java.io.IOException;
import java.io.UnsupportedEncodingException;

import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;

import com.axonactive.yolo.webservice.utils.Utils;

@Path("/exchange_rates_list")
public class ExchangeRatesList {

	/**
	 * @param 
	 * KEY: exchangeRatesListParam 
	 * VALUE: {"timeStamp":"2014-05-05 10:46:19"}
	 * @return
	 * @throws UnsupportedEncodingException
	 * @throws IOException
	 * @throws InterruptedException
	 */
	@POST
	@Path("/get")
	@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
	@Produces(MediaType.APPLICATION_JSON)
	public String getExchangeRatesList(MultivaluedMap<String, String> param)
			throws UnsupportedEncodingException, IOException,
			InterruptedException {
		return Utils.call("get_exchange_rates_list/"
				+ param.getFirst("exchangeRatesListParam"));
	}
}
